package mapper;


import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.log4j.Logger;
import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import entity.SysFunc;

@Mapper 
@Repository
public interface SysFuncRepository extends BaseMapper<SysFunc> {
	
	public static Logger logger = Logger.getLogger(SysFuncRepository.class);  
	public int getCount();

	@Sql(value=" select * from sysconsole.sys_func",returnType=SysFunc.class)
	public List<SysFunc> allSysFuncs();
	
	@Sql(value=" select * from sysconsole.sys_func where seqid = ?",returnType=SysFunc.class)
	public SysFunc findById(long seqid);
	
	@Sql(value=" delete from sysconsole.sys_func where seqid = ?")
	public void deleteForId(long seqid);
	
	@Sql(value=" select * from sysconsole.sys_func where pre_id = ?",returnType=SysFunc.class)
	public List<SysFunc> findByPreId(long preId);
	
	@Sql(value=" select * from sysconsole.sys_func where pre_id = 0",returnType=SysFunc.class)
	public List<SysFunc> findAllPreFunc();
	
	@Sql(value=" select url from sysconsole.sys_func where name = ?",returnType=String.class)
	public String findFuncUrlByName(String name);
	

}
